package com.imooc.util;

import com.imooc.entity.User;

import java.util.ArrayList;

public class SessionUtil {

    public static Object getUserBySessionId(ArrayList<User> userList, String sesstionId) {

        for (int i = 0; i < userList.size(); i++) {
            User user = userList.get(i);
            if (user.getSessionId().equals(sesstionId)){
                return user;
            }
        }
        return null;
    }

}
